package com.ycsj.goldmedalnewconcept.master.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ycsj.common.base.BaseActivity;
import com.ycsj.goldmedalnewconcept.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 校长查看老师教学与反思详情界面
 * Created by Administrator on 2019/5/6 0006.
 */

public class MasterLookTeacherPrepareLessonDetailsActivity extends BaseActivity {

    @BindView(R.id.iv_back)
    ImageView ivBack;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_content)
    TextView tvContent;
    @BindView(R.id.tv_num)
    TextView tvNum;

    //反思的内容
    private String content;

    /**
     * 跳转到当前页面的方法
     *
     * @param context
     * @param content
     */
    public static void goActivity(Context context, String content) {
        Intent it = new Intent(context, MasterLookTeacherPrepareLessonDetailsActivity.class);
        it.putExtra("content", content);
        context.startActivity(it);
    }


    @Override
    protected int getContentLayout() {
        return R.layout.master_activity_look_details;
    }

    @Override
    protected void init() {
        initStateBar();

        //获取内容
        initIntent();

        //初始化标题
        initTitle();

        //设置页面数据
        setPageData();
    }

    /**
     * 获取Intent数据
     */
    private void initIntent() {
        content = getIntent().getStringExtra("content");
    }

    /**
     * 初始化标题栏
     */
    private void initTitle() {
        tvTitle.setText("教学与反思");
    }

    /**
     * 设置页面数据
     */
    private void setPageData() {
        tvContent.setText(content);
        if (content.length() > 500) {
            tvNum.setText("500/500");
        } else {
            tvNum.setText(content.length() + "/500");
        }
    }


    /**
     * 点击事件
     *
     * @param v
     */
    @OnClick({R.id.iv_back})
    public void onViewClicked(View v) {
        switch (v.getId()) {
            case R.id.iv_back:
                //返回
                finish();
                break;
        }
    }
}
